package com.lkwlw.tplms.action;

import java.util.List;
import java.util.Map;

import com.lkwlw.tplms.order.dao.mapper.OrderinfoMapper;
import com.lkwlw.tplms.order.dao.model.Orderinfo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class CheckOrder extends ActionSupport {

private static final long serialVersionUID = 1L;
private String orderId;
private OrderinfoMapper orderInfoDAO;
private List<Orderinfo> maps;


@Override
	public String execute() throws Exception {
	Map session = ActionContext.getContext().getSession();
	session.remove("order");
	session.remove("id");
		if(orderId!=null&&!"".equals(orderId)){
			maps = orderInfoDAO.selectByOrderId(orderId);
			session.put("id", orderId);
			if(maps.size()==0){
				session.put("order", 0);
			}
		}
			return SUCCESS;
	}

	public String getOrderId() {
		return orderId;
	}
	
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	
	public void setOrderInfoDAO(OrderinfoMapper orderInfoDAO) {
		this.orderInfoDAO = orderInfoDAO;
	}
	
	public List<Orderinfo> getMaps() {
		return maps;
	}
	
	public void setMaps(List<Orderinfo> maps) {
		this.maps = maps;
	}
}
